<template>
  <div>
    <h2>道路运输经营许可信息</h2>

    <h5>
      查询指定数据：<input type="text" v-model="searchCondition" placeholder="请输入查询Xxx">
      <el-button type="primary" @click="selectcondition">点击查询</el-button>
    </h5>

    <el-table :data="roadtransportList" style="width: 100%" border empty-text="暂无数据" >

      <el-table-column prop="ADDRESS" label="地址" width="180" />

      <el-table-column prop="APPNO" label="申请号" width="180" />

      <el-table-column prop="BUSISCOPE" label="业务范围" width="180" />

      <el-table-column label="操作">
        <template #default="scope">
          <el-button type="success" @click="test(scope.row)">查看详细</el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-dialog v-model="dialogVisible" title="详细信息" width="30%">
      <div style="text-align: left">
        地址:{{Roadtransport.ADDRESS}}
        <br/>
        申请号:{{Roadtransport.APPNO}}
        <br/>
        业务范围:{{Roadtransport.BUSISCOPE}}
        <br/>
        卡开始日期:{{Roadtransport.CARDBEGINDATE}}
        <br/>
        卡结束日期:{{Roadtransport.CARDENDDATE}}
        <br/>
        卡ID:{{Roadtransport.CARDID}}
        <br/>
        经济类型:{{Roadtransport.ECONOMICTYPE}}
        <br/>
        是否标志:{{Roadtransport.ISFLAG}}
        <br/>
        标签类型:{{Roadtransport.LABELTYPE}}
        <br/>
        许可号:{{Roadtransport.LICENO}}
        <br/>
        颁发日期:{{Roadtransport.LSSUDATE}}
        <br/>
        颁发单位名:{{Roadtransport.LSSUUNITNAME}}
        <br/>
        车牌号:{{Roadtransport.PLATENUM}}
        <br/>
        座位数:{{Roadtransport.SEATS}}
        <br/>
        交通号:{{Roadtransport.TRAFNO}}
        <br/>
        车辆ID:{{Roadtransport.VEHIID}}
        <br/>
        车辆尺寸:{{Roadtransport.VEHISIZE}}
        <br/>
        车辆类型:{{Roadtransport.VEHITYPE}}
        <br/>

        <el-button  @click="addOne(Roadtransport)">
          点击添加
        </el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import axios from "axios";
import {ElMessage} from "element-plus";

export default {
  name: "RoadtransportView",
  data(){
    return {
      roadtransportList:[],
      dialogVisible:false,
      Roadtransport:{},
      searchCondition:"",
    }
  },created() {
    axios("http://localhost:8000/consumerselect/roadtransport").then(
        (res)=>{
          this.roadtransportList = res.data;
          ElMessage.info("数据查询完成")
        }
    )
  },methods:{
    test(row){
      this.Roadtransport = row;
      this.dialogVisible = true;
    },
    selectcondition(){
      axios(`http://localhost:8000/consumerselect/roadtransport?address=${this.searchCondition}`).then(
          (res)=>{
            this.roadtransportList = res.data
            ElMessage.info("条件查询完成")
          }
      )
    },
    addOne(row){
      alert("添加功能还未开放")
    }
  }
}
</script>

<style scoped>

</style>